package com.googlecode.mcwalle.response;

import java.util.Date;

/**
 * @author Li Weibo (weibo.leo@gmail.com) //I believe spring-brother
 * @since 2011-10-28 下午09:27:56
 */
public class ItemInfo {

	private String key;
	
	private int bytes;
	
	private int expire;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public int getBytes() {
		return bytes;
	}

	public void setBytes(int bytes) {
		this.bytes = bytes;
	}

	public int getExpire() {
		return expire;
	}

	public void setExpire(int expire) {
		this.expire = expire;
	} 
	
	public boolean isExpired() {
		//TODO 优化对时间的获取
		return 1000l * this.expire < System.currentTimeMillis();
	}
	
	public String toString() {
		return key + " " + this.bytes + "b " + new Date(1000l * this.expire);
	}
	
}
